<?php

namespace app\controller;

use app\BaseController;
use think\Request;
use app\service\ReceiptFlowService;
use Exception;

class ReceiptFlow extends BaseController
{    
    protected $middleware = [
        \app\middleware\LoginCheck::class
    ];
    protected $request;
    protected $receiptflowService;
    public function __construct(Request $request,ReceiptFlowService $receiptflowService)
    {       
        $this->request = $request;
        $this->receiptflowService = $receiptflowService;
    }    

    public function list()
    {       
        try {   
            $params = $this->request->param();                
            $data = $this->receiptflowService->list($params);
        } catch (Exception $e) {
            return $this->error($e->getMessage());
        }

        return $this->success($data);
    }     
}
